package com.Eastiy.EXO.View;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.LinearGradient;
import android.graphics.Shader;
import android.graphics.Typeface;
import android.text.Spanned;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;

public class NewText extends TextView {
    public NewText(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
    }

    public NewText(Context context, Object obj, String str, int i, String str2) {
        super(context);
        if (str == "LT") {
            setGravity(51);
        } else if (str == "LC") {
            setGravity(19);
        } else if (str == "LB") {
            setGravity(83);
        } else if (str == "CT") {
            setGravity(49);
        } else if (str == "CC") {
            setGravity(17);
        } else if (str == "CB") {
            setGravity(81);
        } else if (str == "RT") {
            setGravity(53);
        } else if (str == "RC") {
            setGravity(21);
        } else if (str == "RB") {
            setGravity(85);
        }
        if (obj instanceof Spanned) {
            setText((Spanned) obj);
        } else {
            setText((String) obj);
        }
        setTypeface(Typeface.createFromAsset(context.getAssets(), "fonts/mihome_icons.ttf"));
        if (!"null".equals(String.valueOf(i))) {
            setTextSize((float) i);
        }
        if (str2 != null) {
            setTextColor(Color.parseColor(str2));
        } else {
            getPaint().setShader(new LinearGradient((float) 0, (float) 0, (float) (getw(this) + 12), (float) 0, Color.parseColor("#465EFB"), Color.parseColor("#C2FFD8"), Shader.TileMode.CLAMP));
        }
    }

    public static int geth(View view) {
        view.measure(View.MeasureSpec.makeMeasureSpec(0, 0), View.MeasureSpec.makeMeasureSpec(0, 0));
        return view.getMeasuredHeight();
    }

    public static int getw(View view) {
        view.measure(View.MeasureSpec.makeMeasureSpec(0, 0), View.MeasureSpec.makeMeasureSpec(0, 0));
        return view.getMeasuredWidth();
    }

    /* access modifiers changed from: protected */
    @Override
    public void onDraw(Canvas canvas) {
        super.onDraw(canvas);
    }
}
